<template>
  <div class="ly-box">
    <!--审核中-->
    <div class="attestation" v-show="isLoading">
      <div class="loading">
        <div class="isLoading-img"></div>
        <!--<p>正确的输入手机号码和身份证号码审核更容易成功</p>-->
        <p>如果长时间未通过请联系物业管理。</p>
      </div>
    </div>
    <!--审核拒绝-->
    <div class="attestation" v-show="isNo">
      <div class="loading">
        <div class="isNo-img"></div>
        <p>您的申请已被拒绝，请联系物业管理进行处理。</p>
      </div>
    </div>


  </div>
</template>

<script>
  import http from "../../http";
  import storage from "../../store/storage.js";

  export default {
    data() {
      return {
        isLoading: true,
        isNo: false,
      };
    },
    created: function () {

      //拉取用户信息 判断用户认证情况
      this.getUserInfo();

    },
    methods: {
      getUserInfo: function () {
        http.get("/communityApps/personalCenter/userInfo").then(res => {
          if (res.data.code == 20000) {
            if (res.data.data.isAuthentication == -1) {
              this.$router.replace("/rongke/attestation");
            } else if (res.data.data.isAuthentication == 2) {
              console.log("审核拒绝");
              this.isLoading = false;
              this.isNo = true;
            } else if (res.data.data.isAuthentication == 3) {
              console.log("审核中");
              this.isLoading = true;
              this.isNo = false;
            } else {
              console.log("已认证")
              // 跳转至个人中心
              this.$router.replace("/rongke/rkUser");
            }
          } else {
            this.$dialog.toast({
              mes: res.data.message,
              timeout: 1500
            });
          }
        });

      },

    }
  };
</script>

<style>
  .ly-box .yd-cell-right select {
    color: #555;
  }

</style>

<style scoped lang="scss">
  .attestation {
    .loading {
      padding-top: 1rem;
      .isLoading-img {
        width: 3rem;
        height: 3rem;
        margin: 0 auto;
        background: url(../../assets/isLoading.png) no-repeat center;
        -webkit-background-size: contain;
        background-size: contain;
        margin-bottom: 0.5rem;
      }
      .isNo-img {
        width: 3rem;
        height: 3rem;
        margin: 0 auto;
        background: url(../../assets/isNo.png) no-repeat center;
        -webkit-background-size: contain;
        background-size: contain;
        margin-bottom: 0.5rem;
      }
      p {
        text-align: center;
        color: #666;
        font-size: 0.3rem;
        line-height: 0.6rem;
      }
    }

  }


</style>
